#ifndef db_proto_h
#define db_proto_h
#include <stdio.h>
#include <vector>
#include <string>
using namespace std;
class JMsgWriter;
class JMsgReader;
class JMsgProto;
enum db_protoTypeIds {
   kDBMSGPlayerInfo = 80,
   kDBMsgActivatePlayerRequest = 5,
   kDBMsgActivatePlayerResponse = 7,
   kDBMsgAddRegisterPlayerRequest = 1,
   kDBMsgAddRegisterPlayerResponse = 2,
   kDBMsgPlayerInfoRequest = 3,
   kDBMsgPlayerInfoResponse = 4,
   kDBMsgSavePlayerInfo = 8,
};

JMsgProto* db_protoCreateProto();
struct DBMSGPlayerInfo {
   DBMSGPlayerInfo();
   string userName;
   int isGuest;
   string nickName;
   string lastLoginTime;
   string phoneNo;
   int score;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgActivatePlayerRequest {
   DBMsgActivatePlayerRequest();
   string guestUserName;
   string newUserName;
   string newPassword;
   string phoneNo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgActivatePlayerResponse {
   DBMsgActivatePlayerResponse();
   bool isSuccess;
   int errorCode;
   string guestUserName;
   string newUserName;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgAddRegisterPlayerRequest {
   DBMsgAddRegisterPlayerRequest();
   string userName;
   string passwordSha1;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgAddRegisterPlayerResponse {
   DBMsgAddRegisterPlayerResponse();
   string userName;
   bool isSuccess;
   int errorCode;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgPlayerInfoRequest {
   DBMsgPlayerInfoRequest();
   int requestId;
   string userName;
   string password;
   bool isGuest;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgPlayerInfoResponse {
   DBMsgPlayerInfoResponse();
   bool isSuccess;
   string userName;
   DBMSGPlayerInfo playerInfo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct DBMsgSavePlayerInfo {
   DBMsgSavePlayerInfo();
   DBMSGPlayerInfo playerInfo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
#endif
